package it.giuseppetrisciuoglio.lyrics.service;

import java.io.IOException;

import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;


public abstract class AbstractJsonService <RESPONSE> {

	protected RESPONSE parseJson(String response, Class responseClass) throws JsonParseException, JsonMappingException, IOException {
		ObjectMapper objectMapper = new ObjectMapper();
		return (RESPONSE) objectMapper.readValue(response,responseClass);
	}
	
}
